home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
bin2asc.zip
/
B2A.DOC
next >
Wrap
Text File
|
1989-09-03
|
11KB
|
213 lines
╔═════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ║
║ ║
║ BIN2ASC.EXE ║
║ DATA CONVERSION - Utility ║
║ User's Guide ║
║ Version 1.00 ║
║ Released 08/10/89 ║
║ ║
║ ========================== ║
║ ║
║ Copyright (c) 1989 ║
║ Carl F. Howard ║
║ 11321 Fairview St. ║
║ El Monte, CA 91732 ║
║ ║
║ BIN2ASC.C Version 1.00 (c) Copyright 1989 ║
║ ALL RIGHTS RESERVED ║
║ ║
║ ║
╚═════════════════════════════════════════════════════════════════════════════╝
BIN2ASC is the copyrighted property of Carl F. Howard. You are
granted a limited license to use BIN2ASC, and to copy it and
distribute it, provided that the following conditions are met:
1) You may not charge a fee for such copying and distribution.
2) You must distribute BIN2ASC as a complete set of files.
3) You may ONLY distribute BIN2ASC in its original, unmodified state.
This program is being distributed under the Sharware concept
where users are urged to distribute this program in original
form, not modified in any way, to their friends and other BBS's.
The author claims no responsibility for any damage either
accidental or otherwise through use of this program. The program
is provided "AS IS" without warranty of any kind, either
expressed or implied. The entire risk as to the quality and
compatibility of the program is with YOU.
If you use this program and find it of value, any contributions
($25 suggested) will be greatly appreciated and will be used to
further develop useful software. Send contributions to:
Carl F. Howard
11321 Fairview St.
El Monte, CA 91732
============================================================================
-------
BIN2ASC
-------
This Utility can be used to Port Data between different DB applications, by
converting binary formated (Byte Stream) data files to (ASCII) sdf files.
The program reads each byte in the source file and translates non alpha-
numeric data to spaces ( ASCII Value=032 hex Value=20h ), not null's 000 or
00h. It is non-destructive. It does not change any data in the source file.
All characters are are written to the target file, including spaces. This
will maintain the record size integrity of the source file and the target
file will contain only printable ASCII characters. Note, after the specified
number of bytes for Record Size are written to the target file, a proper
MSDOS lf/cr 0Dh 0Ah sequence is added to the end of each output line.
To RUN:
Copy BIN2ASC.EXE to any Directory listed in your DOS path and type BIN2ASC
at the DOS prompt.
C>:BIN2ASC
You will see an information screen describing the program and giving
brief instructions. Hit any key to exit the screen and continue the
program.
A new Screen will then be presented prompting you for information about
the source and target files. Just enter the information prompted for by
the program.
Note the following;
1. You MUST specify the Input and Output File names.
The files can be any leagal DOS name in any DOS directory.
If the target file exsist you will be prompted before overwriting it.
If you do not want to overwrite the target file type "n" at the prompt
and BIN2ASC will abort! Not graciously but you won't loose any data.
2. YOU MUST specify an initial number of bytes to be Ignored when reading
the source file ( Note, you MUST Enter 0 if none ). This will strip
header info and non-record data if it exsist at the begining of the
source file.
This is neccessary since most data files contain some information about
the records contained in them, field names, types, size, and record
length etc.
BIN2ASC allows you to filter this information before records are written
to the target file so that is contains only DATA.
Tip: If you don't know how many bytes preceed the actual data in the
file, use any file dump utility to examine the file and count the
number of characters you see that come before the data starts.
Enter this number when prompted.
3. You MUST specify the record size (number of columns) for the Output File.
Finally, you have to know how many bytes are contained in each record of
the source file. If you are converting from an exsisiting apllication and
have this information available it should be equal to the total number
of characters contained in all of the fields. dBase will indicate the
record lenth if you use the DISPLAY STRUCTURE command.
Tip: The above method dosen't always work, your Data file may contain
characters in addition to the DATA, which are used to delimit
records. Here again it is advisable to Use a DUMP utilty to examine
the file and physicaly count the number of bytes between records.
Once you have entered all of the above information the program will
execute. You will see a status screen indicating the job start time
and the number of records successfuly created. You may abort the
processing at any time by hitting any key while the records are being
created. If you have aborted proccessing or the job has ended sucessfully
you will be presented with an EXIT screen indicating the total job time
and total number of records converted.
Technical Notes and other stuff! :
BIN2ASC was written using Microsoft Quick C version 2.0. The code is
supposed to be compatible with other Microsoft C Compilers. It does
use MSDOS specific functions for computing time but this could be
easily modified for use with other operating systems.
You should be able to use this utility with any MSDOS or CP/M data
file that stores information in ASCII form. If you are attempting
to convert data from a main frame you will need to make sure that
the source file has been translated from EBCIDIC to ASCII as this
program does not make translations and assumes ASCII format.
SPEED! -- C HOW FAST!!!
This utility was developed and tested on a 12Mhz AT 0 wait Clone.
This program was originaly written with Turbo Pascal Ver 3.00.
Essentialy the same code, the PASCAL version took over 7 minutes and
30 seconds to convert 1489, 256 Byte records ( In A RAM DISK ). The
C Version accomplishes the same task in 22 seconds. AWESUM! Do you
think it would run any faster in assembly??
The manual states that Quick "C" compiler optimises code for speed
(Default mode, other options are available) and additionaly offers
an option to decalre variables as (registers) types. Of course I
used t